#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	int n;
	cin >> n;
	while (n--) {
		int a, b;
		char op;
		cin >> a >> op >> b;
		if (op == '+') {
			cout << a + b << endl;
		} else if (op == '-') {
			cout << a - b << endl;
		} else if (op == '*') {
			cout << a*b << endl;
		} else if (op == '/') {
			cout << (!b ? "Divided By Zero" : to_string(a / b)) << endl;
		} else if (op == '%') {
			cout << (!b ? "Divided By Zero" : to_string(a % b)) << endl;
		} else {
			cout << "Invalid Operator" << endl;
		}
	}
	return 0;
}
